A closed interrupt window is a time interval during software execution when interrupts may not be delivered to the software. Alternatively, an open interrupt window is a time interval during software execution when interrupts can be delivered to the software. The opening and closing of the interrupt window may occur through a number of mechanisms.
The interrupt window may be closed because the software does not want to be interrupted. For example, an instruction set architecture (ISA) may allow software to block external interrupts through a masking bit or some other mechanism. In particular, in the ISA of the Intel® Pentium® 4 (referred to herein as the IA-32 ISA), hardware interrupts are blocked if the IF bit in the EFLAGS register is cleared. The IF bit may be set or cleared by instructions that load the EFLAGS register (e.g., POPF) or by instructions that explicitly set or clear the IF bit (e.g., STI, CLI). Additionally, certain machine transitions may make modifications to the IF bit (e.g., interrupt and exception vectoring may cause the IF bit to be cleared).
The interrupt window may be closed because the software is in the midst of a transition in machine state that precludes delivering the interrupt. In the IA-32 ISA, for example, because the proper vectoring of an interrupt requires the stack segment and stack pointer to remain consistent, the CPU may automatically block interrupt vectoring while the software update of the stack segment and stack pointer (MOVSS/POPSS) takes place. Additionally, the IA-32 ISA dictates that the execution of an STI instruction that sets the IF bit does not take effect until the instruction following the STI completes. Hence, the interrupt window opens one instruction after the STI.
Additional events, for example, non-maskable interrupts (NMIs), system management interrupts (SMIs), etc. may have similar event blocking semantics. A closed event window is a time interval during software execution when the associated event may not be delivered to the software. Alternatively, an open event window is a time interval during software execution when the associated event can be delivered to the software.
Depending on the specific ISA, the event window conditions may be rather complex, requiring evaluation of detailed information on the state of the processor to determine if software has an open event window for a given event.